home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3995 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.3 KB

  1. Path: freenet3.freenet.ufl.edu!afn03257
  2. From: afn03257@freenet3.freenet.ufl.edu (Daniel P Hudson)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: Clearing the keyboard buffer
  5. Followup-To: alt.msdos.programmer
  6. Date: 27 Jan 1996 04:05:57 GMT
  7. Message-ID: <4ec8b5$1fm@huron.eel.ufl.edu>
  8. References: <4dtqi4$60u@cdc2.cdc.net>,<4e07uh$oqq@huron.eel.ufl.edu>
  9.  <DLt4p1.37x@news.cern.ch>
  10. NNTP-Posting-Host: freenet3.afn.org
  11. X-Newsreader: wsOMR/SOUP v1.00 [NR]
  12.  
  13. In article <DLt4p1.37x@news.cern.ch>,
  14. loreti@mxsld2.pd.infn.it (Maurizio Loreti) wrote:
  15.  
  16.  > I'm using Turbo C++ v. 3.1 and I need to be able to clear the
  17.  > keyboard BTW, this following bit of code wouldn't work :
  18.  
  19.  > > > while(kbhit()) getch();
  20.  
  21.  > > > Because I want the user to be able to just keep pushing the same key,
  22.  > > > making the above loop infinitly. If I don't clear the keyboard
  23.  
  24.  > > Huh? Once the buffer is caught up, it shouldn't continue, but you
  25.  > > might want to try fflush(stdin);
  26.  
  27.  > Bullshit.  Read the FAQ list to learn why this is an error;
  28.  > specifically Q/A 12.26:
  29.  
  30.  I'm not posting from c.l.c, and I flat out don't care what the 
  31.  anal-retentive ANSI-C users say. He posted this to alt.msdos.programmer 
  32.  where I answered it. If you'd take 2 seconds to read his original code 
  33.  you'd notice ANSI is not on his list of do's. getch()? kbhit()? 
  34.  Several DOS C compilers support fflush(stdin); and have for some time now.
  35.  Sorry for going off half-cocked, but I've already recieved 3 extremely 
  36.  rude e-mail's about this, and now I've got 2 or 3 listed in 
  37.  alt.msdos.programmer, from users who apparently can't handle the
  38.  fact my answer works in his situation, in a.m.p, ANSI C in not the only
  39.  thing permitted and we kind of like it that way, so please try
  40.  and check the header's before you rant off to users who really don't care
  41.  what your precious FAQs or documents say.
  42.  
  43.  Had I of realized he was cross-posting this at the time I would have 
  44.  trimmed the header to prevent such egocentric rantings.
  45.  
  46.  This reply was posted to c.l.c and c.l.c++ to clear up the issue.
  47.  Replies have been re-directed to a.m.p, everyone else should just drop it,
  48.  your creating 10X the wasted bandwidth by ranting that I did by 
  49.  forgetting to simply check my header anyway.
  50.  
  51.  BTW, my reply to Craig, should anyone care about typematic delays, has
  52.  had the header trimmed to alt.msdos.programmer only. Thank You.
  53.